//
//  FMCommonTool.m
//  FantasyMonster
//
//  Created by 冯志强 on 2024/1/29.
//

#import "FMCommonTool.h"

@implementation FMCommonTool

+(CGFloat)getStatusHeight{
    
    CGFloat statusBarHeight = 0;
       if (@available(iOS 13.0, *)) {
           UIWindowScene *windowScene = (UIWindowScene *)[UIApplication sharedApplication].connectedScenes.allObjects.firstObject;
           statusBarHeight = windowScene.statusBarManager.statusBarFrame.size.height;
       } else {
           statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
       }
    
    return statusBarHeight;
}

+(BOOL)getDeviceIsPad{
    
    NSString *deviceType = [UIDevice currentDevice].model;

      if([deviceType isEqualToString:@"iPhone"]) {

          //iPhone
          return NO;
      }

      else if([deviceType isEqualToString:@"iPod touch"]) {

          //iPod Touch
          return NO;
      }

      else if([deviceType isEqualToString:@"iPad"]) {

          //iPad
          return YES;
      }
      return NO;
}
@end
